<ul ui-sortable="sortableOptions" ng-model="layouts" class="nav nav-tabs layout-tabs">
    <li ng-repeat="layout in layouts" ng-class="{ active: layout.active }">
        <a ng-click="makeLayoutActive(layout)">
            <span ng-dblclick="editTitle(layout)" ng-show="!layout.editingTitle">{{layout.title}}</span>
            <form action="" class="layout-title" ng-show="layout.editingTitle" ng-submit="saveTitleEdit(layout)">
                <input type="text" ng-model="layout.title" class="form-control" data-layout="{{layout.id}}">
            </form>
            <span ng-if="!layout.locked" ng-click="removeLayout(layout)" class="glyphicon glyphicon-remove remove-layout-icon"></span>
            <!-- <span class="glyphicon glyphicon-pencil"></span> -->
            <!-- <span class="glyphicon glyphicon-remove"></span> -->
        </a>
    </li>
    <li>
        <a ng-click="createNewLayout()">
            <span class="glyphicon glyphicon-plus"></span>
        </a>
    </li>
</ul>
<div ng-repeat="layout in layouts | filter:isActive" dashboard="layout.dashboard" template-url="components/directives/dashboard/dashboard.html"></div>